package com.guoxin.concurrentcy.chapter2.bank;

/**
 * @author guoxin
 * @date 2019/7/1
 */
public class TicketWindowRunnable implements Runnable {

    private final int MAX = 50;

    private static int index = 1;

    @Override
    public void run() {
        while (index <= MAX) {
            try {
                Thread.sleep(200);
                System.out.println(Thread.currentThread().getName() + "，当前号码是：" + index++);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
